<?php
/**
 * Created by PhpStorm.
 * User: tandunzhao
 * Date: 2018/5/30
 * Time: 下午1:42
 */

namespace App\Modules\Shop\Models;


use Illuminate\Database\Eloquent\Model;

class Cart extends Model
{
    protected $table = 'cart';
    protected $fillable = ['id','uid','product_id','count','created_at','updated_at'];

    public function products() {
        return $this->hasOne('App\Modules\Shop\Models\Products', 'id','product_id');
    }

    public static function getCartListByUid($uid){
        return self::where('uid',$uid)->paginate();
    }
}